import { PageDto } from "../models/page.model";
import { Tweet } from "../models/tweet.model";
import { GlobalService } from "./global.service";


export class UaInfoService {
  static PATH = "/ua/info";
  static searchWithPage(page: number) {
    return new Promise<PageDto<Tweet>>(
      (resolve, reject) => {
        wx.request({
          url: `${GlobalService.HOST}${UaInfoService.PATH}/search?page=${page}`,
          method: "POST",
          success: (response) => resolve(response.data as PageDto<Tweet>),
          fail: (err) => reject(err)
        });
      }
    )
  }
}
